xenpaging: improve policy mru list handling
authorOlaf Hering <olaf@aepfle.de>
Sun, 20 Nov 2011 16:02:50 +0000 (17:02 +0100)
committerOlaf Hering <olaf@aepfle.de>
Sun, 20 Nov 2011 16:02:50 +0000 (17:02 +0100)
commitc9e6b36d433e949e7e18b90b02db8449f84a0b68
tree0303f9bbe473039c61b98bb8ca53560ad83ebdd4
parent6ca25a68ea914dd9c53d837db6d2f54ee823ca4d
xenpaging: improve policy mru list handling

Without this change it is not possible to page-out all guest pages, then
trigger a page-in for all pages, and then page-out everything once
again. All pages in the mru list can not be paged out because they
remain active in the internal bitmap of paged pages.

Use the mru list only if the number of paged-out pages is larger than
the mru list. If the number is smaller, start to clear the mru list. In
case the number of paged-out pages drops to zero the mru list and the
internal bitmap will be empty as well.

Also add a new interface for dropped pages. If a gfn was dropped there
is no need to adjust the mru list because dropping a page is not usage
of a page.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
tools/xenpaging/policy.h
tools/xenpaging/policy_default.c
tools/xenpaging/xenpaging.c